<%@page import="util.enviaEmail"%>
<%
Connection conn = null;
try {
	conn = new Conexao().getConexao();
} catch (Exception e) {
	new enviaEmail().enviar(e);
	out.print("falhaConexao");
	return;
}
%>
<%@page import="java.sql.Connection"%>
<%@page import="conexao.Conexao"%>
<%@page import="dao.funcaoDao"%>
<%@page import="bean.funcaoBean"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style>
#divCadastroUsuario select {
	width: 150px;
	height: 25px;
}
</style>
<script>
$(function(){

	$("#cadastroCPF").mask("999/999/999-99");
	$("#cadastroCPF").blur(function(){
		if($(this).val() == "___/___/___-__"){
			$(this).val("");
		}
	});	
	$("#cadastroTelefone").mask("(99)9999-9999");
	$("#cadastroTelefone").blur(function(){
		if($(this).val() == "(__)____-____"){
			$(this).val("");
		}
	});
	$("#cadastroComissao").maskMoney({precision:1});
	
});
</script>
</head>
<body>
	<div id="divCadastroUsuario">
		<p id="mensagemCadastrarUsuario">Por favor informe os dados do
			novo Usuário.</p>
		<form id="formCadastrarUsuario" class="form">
			<table border="0" cellpadding="2" cellspacing="1">
				<tr>
					<td colspan="2">Nome<br /> <input type="text"
						id="cadastroNome" name="cadastroNome"
						class="text ui-widget-content ui-corner-all" size="60"></td>
				</tr>
				<tr>
					<td>Comissão (só designer)<br /> <input type="text"
						maxlength="5" id="cadastroComissao" name="cadastroComissao"
						class="text ui-widget-content ui-corner-all" size="22"><font size="4" style="padding-right: 13px;">%</font>
					</td>
					<td>Função<br /> <select id="selFuncao" name="selFuncao">
							<option value="" disabled="disabled" selected="selected">Selecione</option>
							<%
								List<funcaoBean> funcoes = new funcaoDao().getLista(conn);
								for (int i = 0; i < funcoes.size(); i++) {
							%>
							<option value="<%=funcoes.get(i).getId()%>" ><%=funcoes.get(i).getNome()%></option>
							<%
								}
							%>
					</select>
					</td>
				</tr>
				<tr>
					<td colspan="2">
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<table cellspacing="3">
							<tr>
								<td>Login<br /> <input type="text" size="17"
									id="cadastroLogin" name="cadastroLogin" maxlength="10"
									class="text ui-widget-content ui-corner-all"></td>
								<td>Senha<br /> <input type="password" size="17"
									id="cadastroSenha" name="cadastroSenha" maxlength="10"
									class="text ui-widget-content ui-corner-all"></td>
								<td>Confirmar Senha<br /> <input type="password" size="17"
									id="cadastroConfSenha" name="cadastroConfSenha" maxlength="10"
									class="text ui-widget-content ui-corner-all"></td>
							</tr>

						</table>
					</td>
				</tr>
			</table>
		</form>
	</div>	
	<%conn.close(); %>
</body>
</html>